<?php
require __DIR__.'/../vendor/autoload.php';

use Hphp\Foundation\Application;
use Hphp\Support\Facades\Route;

$app = new Application($_ENV['APP_BASE_PATH'] ?? dirname(__DIR__));

// 处理http请求的
$app->singleton(
    \Hphp\Contracts\Http\Kernel::class,
    \App\Http\Kernel::class
);

$kernel = $app->make(\Hphp\Contracts\Http\Kernel::class, [$app]);

$response = $kernel->handle(
    \Hphp\Request\Request::capture()
);

echo $response;
//echo json_encode($app->make('config')->all());